package com.itbaizhan.feedback.controller;

import com.itbaizhan.common.vo.HasMoreResult;
import com.itbaizhan.common.vo.LivegoodsResult;
import com.itbaizhan.feedback.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeedbackController {

    @Autowired
    private FeedbackService feedbackService;

    @GetMapping("/comment")
    public LivegoodsResult getComment(Long id, Integer page, @RequestParam(defaultValue = "5") Integer pageSize) {
        return feedbackService.showComment(id, page, pageSize);
    }

    @PostMapping("/feedback")
    public LivegoodsResult addComment(Long orderId,String feedback,Integer rate) {
        return feedbackService.addFeedback(orderId,feedback,rate);
    }
}
